<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../include/head.jspf"%>  

<head>
<title>东方易云后台管理系统</title>
<script language="javascript">
function addApplicationInfo(){
	var errorMsg = "";
	if(isNull($("#applicationName").val())){
		errorMsg +='\n'+ '<spring:message code="message.app.applicationName.is.blank" />';
	}
	if(isNull($("#appUrl").val())){
		errorMsg +='\n'+'<spring:message code="message.app.appUrl.is.blank" />';
	}
	if(isNull($("#applicationDesc").val())){
		errorMsg +='\n'+ '<spring:message code="message.app.applicationDesc.is.blank" />';
	}
	if(isNull($("#imageUrl").val())){
		errorMsg +='\n'+ '<spring:message code="message.app.imageUrl.is.blank" />';
	}
	if (checkRadioStat("status")==false){
		errorMsg +='\n'+ '<spring:message code="message.app.status.not.select" />';
	}
	
	if(errorMsg != ""){
		alert(errorMsg);
		return;
	}else{
		$('#editForm').attr("action","/app/editSubmit");
		$('#editForm').submit();
	}
}

function goBack(){
	$('#editForm').attr("action","/app/list");
	$('#editForm').submit();
}
</script>
</head>

<body>
<form method="post" id="editForm">
	<table border="1">
	    <tr><td >修改应用信息 <input name="applicationId" type="hidden" value="<c:out value='${applicationVO.applicationId}' />" >
						  <input name="pageNo" type="hidden" value="<c:out value='${pageNo}'/>" >
					      <input type="hidden" id="applicationNameSearch" name="applicationNameSearch" value="<c:out value='${applicationNameSearch }' />">
					      <input type="hidden" id="providerNameSearch" name="providerNameSearch" value="<c:out value='${providerNameSearch }' />">
		</td></tr>
		<tr><td>应用名称:</td><td><input id ="applicationName" name="applicationName" type="text" value="<c:out value='${applicationVO.applicationName}'/>"></td></tr>
		<tr><td>应用类别:</td><td><input id ="applicationTypeKeyId" name="applicationTypeKeyId" type="text" readonly="true"  value="<c:out value='${applicationVO.applicationTypeKeyId}'/>"></td></tr>
		<tr><td>是否为普通应用:</td><td>是：<input id="commomFlag" name="commomFlag" type="radio" value="Y" <c:if test="${applicationVO.commomFlag eq statusYes}">checked</c:if> /> 否：<input id="commomFlag" name="commomFlag" type="radio"  value="N" <c:if test="${applicationVO.commomFlag eq statusNo}">checked</c:if> /></td>
		<tr><td>是否为实施应用:</td><td>是：<input id="implementFlag" name="implementFlag" type="radio" value="Y" <c:if test="${applicationVO.implementFlag eq statusYes}">checked</c:if>/> 否：<input id="implementFlag" name="implementFlag" type="radio"  value="N" <c:if test="${applicationVO.implementFlag eq statusNo}">checked</c:if>/></td>
		<tr><td>应用的版本号:</td><td><input id ="applicationVersion" name="applicationVersion"  type="text" readonly="true" value="<c:out value='${applicationVO.applicationVersion}'/>"></td></tr>
		<tr><td>应用URL:</td><td><input id ="appUrl" name="appUrl" type="text" value="<c:out value='${applicationVO.appUrl}'/>"></td></tr>
		<tr><td>应用描述:</td><td><input id ="applicationDesc" name="applicationDesc" type="text" value="<c:out value='${applicationVO.applicationDesc}'/>"></td></tr>
		<tr><td>应用指导价格:</td><td><input id ="price" name="price" type="text" value="<c:out value='${applicationVO.price}'/>"></td></tr>
		<tr><td>应用图片:</td><td><input id ="imageUrl" name="imageUrl" type="text" value="<c:out value='${applicationVO.imageUrl}'/>"></td></tr>
		<tr><td>提供商:</td>
		<td>
		<c:forEach var="organizationVO" items="${findProvider}" >
			<input id ="supplier" name="supplier" type="text" readonly="true" value="<c:out value='${organizationVO.chineseName}'/>">
		</c:forEach> 
		</td>
		</tr>
		<tr><td>应用状态:</td><td>启用：<input id="status" name="status" type="radio" value="1" <c:if test="${applicationVO.status eq statusOne}">checked</c:if>/> 停用：<input id="status" name="status" type="radio"  value="0" <c:if test="${applicationVO.status eq statusZero}">checked</c:if> /></td></tr>
		<tr><td>备注:</td><td><input id ="memo" name="memo" type="text" value="<c:out value='${applicationVO.memo}'/>"></td></tr>
		<tr><td><input type="button" value="确定" onclick="javascript:addApplicationInfo();"/><input type="button" value="取消" onclick="javascript:goBack();"/></td></tr>
	</table>

</form>
</body>

</html>
